<template>
    <view class="mt80 pd">
        <input type="text" value="" placeholder="请设置标签名称" class="jhhgerttyt"  v-model="name"/>
    </view>
</template>
<script>
    export default {
        data() {
            return {
				name:'',
				gid:'',
				carform:{}
			}
        },
        components: {},
        methods: {
			async addcar(){
				console.log(this.name)
				if(!this.name){
					uni.showToast({
						icon:"none",
						title:'请输入标签名称'
					})
					return
				}
				this.carform.name=this.name
				this.carform.gid=this.gid
				let params={}
				params=this.carform
				let car= await this.post('/api/group_label',params)
								
				console.log("添加标签",car)
				uni.showToast({
					title:"添加成功"
				})
				setTimeout(function(a){
					uni.redirectTo({
						url:'GroupDetails'
					})
				},2000)
				
			}
		},
		onNavigationBarButtonTap() {
			this.addcar()
			
		},
		onLoad(options){
			this.gid = options.gid
			console.log(options)
		},
        mounted() {}
    }

</script>
<style  scoped>
  
</style>
